package com.hxd.mall.module.account.register

import com.hxd.mall.network.base.BaseRequest
import com.hxd.mall.network.service.ManagerFunctionApi
import com.hxd.mall.network.service.ManagerFunctionApi.mIAccountFunctionApi
import com.hxd.mall.utils.local.RequestUtil
import com.hxd.mall.utils.open.ToastUtil
import java.util.*
import javax.inject.Inject

/**
 * @author zhaoyong
 * @description:
 * @date :2019-10-15 15:27
 */
class BindPhonePresenter @Inject constructor(var mView: IBindPhoneView) : IBindPhonePresenter {

    override fun invitationCode(invitationCode: String) {
        BaseRequest.request(mIAccountFunctionApi.invitationCode(invitationCode), mView, {
            if (it.code == 0) {
                mView.invitationCodeResult(it)
            } else {
                ToastUtil.showToast(it.msg ?: "")
            }
        }, {
            ToastUtil.showToast(it.msg ?: "")
        })
    }

    override fun getData(isRefresh: Boolean) {

    }
}